<?php echo View::factory('admin/sys/sys_left')->render(); ?>
<script type="text/javascript" src="/media/js/my_validation.js"></script>
<script>
    $(document).ready(function() {
        var chrvalue = '<label for="chr_value" class="lable_title" >参数值<span class="req">*</span></label>';
        $('#chr_value').html(chrvalue +'<input name="chr_value" id="chr_value" class="text medium required"  value=""/>');
        
        $("input[name]=chr_type").click(function() {
            if($(this).is(':checked')){
                if($(this).val() == 'strings') {
                    $('#chr_value').html(chrvalue +'<textarea name="chr_value" id="chr_value" class="textarea required" style="width:500px;height:100px;"></textarea>');
                } else if($(this).val() == 'bool') {
                    $('#chr_value').html(chrvalue +'<input class="radio" type="radio" checked="checked" value="1" name="chr_value">'+
                        '<label class="choice">是</label><input class="radio" type="radio" value="0" name="chr_value">'+
                        '<label class="choice">否</label>');
                } else {
                    $('#chr_value').html(chrvalue +'<input name="chr_value" id="chr_value" class="text medium required"  value=""/>');
                }
            }
        });
    });
</script>
<div id="do_right" class="catalog_right">
    <div class="box" style="overflow:hidden;">
        <h3 id="h3_left">添加网站参数</h3>
        <div id="right_button"><a href="/admin/sys/list"><button id="back">返回参数列表</button></a></div>
        <div class="clear"></div>
        
        <form method="post" action="/admin/sys/add/" class="need_validation" id="commentForm" >
            <div id="tabs">
                <ul>
                    <li><a href="#tabs-1">基本资料</a></li>

                </ul>
                <!--START tabs-1 -->
                <div id="tabs-1">
                    <ul>
                        <li>
                            <label for="chr_name" class="lable_title">参数名称<span class="req">*</span></label>
                            <input name="chr_name" id="chr_name" class="text medium required" type="text" value=""/>
                        </li>
                        <li>
                            <label for="chr_fieldname" class="lable_title">字段值<span class="req">*</span></label>
                            <input name="chr_fieldname" id="chr_fieldname" class="text medium required"  value=""/>
                        </li>

                        <li>
                            <label for="chr_type" class="lable_title">参数类型</label>
                            <input class="radio" type="radio" value="string" checked="checked" name="chr_type">
                            <label class="choice">文本</label>
                            <input class="radio" type="radio" value="bool" name="chr_type">
                            <label class="choice">布尔</label>
                            <input class="radio" type="radio" value="number" name="chr_type">
                            <label class="choice">数字</label>
                            <input class="radio" type="radio" value="strings" name="chr_type">
                            <label class="choice">多行文本</label>
                        </li>
                        <li id="chr_value">
                        </li>
                        <li>
                            <label for="chr_info" class="lable_title">参数说明</label>
                            <input name="chr_info" id="chr_info" class="text medium" type="text" value=""/>
                        </li>

                    </ul>
                    <div style="clear:both;"></div>
                </div>
                <!--END tabs-1 -->
            </div>
            <ul>
                <li style="text-align: center;">
                    <input value="保存" class="button" type="submit"/>
                </li>
            </ul>
        </form>
    </div>
</div>
